<script type="text/html" template>
  <link rel="stylesheet" href="{{ layui.setter.base }}style/alert.css">
  <link rel="stylesheet" href="{{ layui.setter.base }}style/autoComplete.css">
</script>
<style scoped>
  .layui-form-label {
    width: 80px;
    font-size: 10px;
  }
  .layui-btn-container .layui-btn+.layui-btn {
    margin-left: 40px;
  }
  .inputPonser {
    font-weight: bold;
    text-align: center;
    font-size: 13px;
    margin-bottom: 7px;
  }
  .layui-input{
    height: 25px;
  }
  .layui-form-label{
    padding: 4px 15px;
  }
  .layui-input-block{
    width: 195px;
  }
</style>

<div class="layui-form row" lay-filter="layuiadmin-form-tags" id="layuiadmin-form-tags">
  <div class="form layui-form-item">
    <label class="layui-label-inlineblock layui-form-label" data-lang="staffNumber">员工工号：</label>
    <div class="layui-input-block" id="test">
      <input type="text" name="tcHrGen01" autocomplete="off" class="layui-input" id="tcHrGen01">
    </div>
  </div>


  <div class="layui-form-item">
    <label class="layui-form-label" data-lang="employeePost">员工岗位：</label>
    <div class="layui-input-block">
      <input type="text" name="tcHrJob" autocomplete="off" class="layui-input" id="one_llp">
    </div>
  </div>


  <!-- 上级领导 -->
  <div class="form layui-form-item">
    <label class="layui-label-inlineblock layui-form-label" data-lang="SuperiorLeader">上级领导：</label>
    <div class="layui-input-block">
      <select id="tcHrSup" name="tcHrSup" placeholder="请输入原所属公司" lay-verify="tcHrSup" lay-search>
        <option></option>
      </select>
    </div>
  </div>


  <div class="layui-form-item">
    <label class="layui-form-label" data-lang="OACode">OA编号：</label>
    <div class="layui-input-block">
      <input type="text" name="tcHrOa" autocomplete="off" class="layui-input" id="two_llp" lay-verify="required">
    </div>
  </div>

  <div class="form layui-form-item">
    <label class="layui-label-inlineblock layui-form-label" data-lang="SystemLanguage">系统语言：</label>
    <div class="layui-input-block">
      <select name="tcHrLanguage" placeholder="请输入原所属公司" lay-verify="required">
        <option value="SC">中文</option>
        <option value="EN">英文</option>
      </select>
    </div>
  </div>

  <div class="footer layui-btn-container" style="margin-top: 30px;">
    <button data-lang="confirm" class="btn1 layui-btn layui-btn-radius layui-btn-primary"
      lay-filter="layuiadmin-app-form-submit" lay-submit>确定</button>
    <button data-lang="cancel" class="btn2 layui-btn layui-btn-radius layui-btn-primary">取消</button>
  </div>
</div>

<script>
  layui.use(['table', 'laypage', 'form', 'jquery', 'laytpl', 'api', 'admin','utill'], function () {
    var table = layui.table;
    var form = layui.form;
    var laypage = layui.laypage;
    var $ = layui.jquery;
    var api = layui.api;
    var laytpl = layui.laytpl;
    var router = layui.router();
    var id = router.search.id;
    var admin = layui.admin;
    var utill = layui.utill;
    var aa = {};
    form.render();
    reanderSelect(aa);
    function reanderSelect(aa) {
      // 上级领导
      admin.req({
        type: 'post',
        url: api.host + api.selectPeople,
        data: JSON.stringify(aa),
        dataType: 'json',
        contentType: 'application/json',
        success: function (response) {
          var datas = response.data;
          if (datas != null || datas.size > 0) {
            var _select;
            datas.forEach((item) => {
              _select += `<option value="${item.TC_HR_GEN01}">${item.GEN02} - ${item.TC_HR_GEN01}</option>`
            })
            $("#tcHrSup").append(_select);
            form.render();
          }
        }
      })
    }
 
  })
</script>